# Contributor: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
# Maintainer: Iztok Fister, Jr. <iztok@iztok-jr-fister.eu>
pkgname=wiki2beamer
pkgver=0.10.0
pkgrel=2
pkgdesc="Create latex beamer code from an easy, wiki-like syntax"
url="https://github.com/wiki2beamer/wiki2beamer"
arch="noarch"
license="GPLv2+"
depends="python3"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/wiki2beamer/wiki2beamer/archive/wiki2beamer-v$pkgver/wiki2beamer-$pkgver.tar.gz"

prepare() {
default_prepare
# inspired by Fedora build
for file in $pkgname-$pkgname-v$pkgver/code/$pkgname $pkgname-$pkgname-v$pkgver/tests/test_wiki2beamer.py; do
	sed -i '1s|^#!/usr/bin/env python|#!%{__python3}|' $file
done
}

build() {
	cd $pkgname-$pkgname-v$pkgver/code
	python3 setup.py build
	cd ..
}

check() {
	cd tests
	python3 test_wiki2beamer.py
}

package() {
	cd src/$pkgname-$pkgname-v$pkgver/code
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
712c719bcdd97f48c65aff1919f2e6a838a0beba1d2e5569063fd1f84bf68eda3137ac20e5dc463dff64c8b4656ce0bf02a0acea090b9a30262374cbee5db433  wiki2beamer-0.10.0.tar.gz
"
